-- drop function public.raise_exception(text);
create or replace function public.raise_exception(text) returns void AS $$
-- This function raises an exception and returns a message passed as arg. It has been used in RULEs where an invalid insert or update is performed. 
  BEGIN
     -- Raise an exception.
    RAISE EXCEPTION '%', $1;
  END;
$$
LANGUAGE 'plpgsql';